/******************************init****************************/
function queryEnergyConservation(page) {
	var parm = $('#queryEnergyConservationForm').serialize() + (page != null ? ('&page=' + page) : '');
	var url = create_url('energyconservation-query');
	sys_record_parm('energyconservation',parm);
	sys_loading();
	$.ajax({type:'POST', url:url, data:parm,
		success: function(result) {
			sys_loading_close();
			$('#resultList').html(result);
		}
	});
}

function deleteEnergyConse(code) {
	$.Zebra_Dialog('是否删除',{
			'type': 'question',
			'title': '警告' ,
			'buttons':[
			           {caption:'删除',callback:function() {
			        	 	var url = create_url('energyconservation-delete');
							energyConse_aidExecute(code, url);
			    		}},
			           {caption:'取消',callback:function(){}
			    	}]
			});
}

function energyConse_aidExecute(code, url) {
	var parm = {'code':code};
	sys_submiting();
	$.ajax({type:'POST', url:url, data:parm,
		success: function(result) {
			sys_submiting_close();
			if ('success' == result) {
				sys_msg('操作成功');
				queryEnergyConservation();
			} else {
				sys_msg('操作失败');
				queryEnergyConservation();
			}
		}
	});
}
function topEc(code) {
	$.Zebra_Dialog('是否要置顶',{
			'type': 'question',
			'title': '警告' ,
			'buttons':[
			           {caption:'置顶',callback:function() {
			        	 	var url = create_url('energyconservation-energyconservationTop')
							var parm = {'code':code};
							sys_submiting();
							$.ajax({type:'POST', url:url, data:parm,
								success: function(result) {
									sys_submiting_close();
									if ('success' == result) {
										sys_msg('置顶成功');
										queryOrganActivities();
									} else {
										sys_msg('操作失败');
										queryOrganActivities();
									}
								}
							});
			    		}},
			           {caption:'取消',callback:function(){}
			    	}]
			});
}
/************edit******************/
function saveEnergyConservation() {
	var parm = $('#editEnergyConservationForm').serialize() + '&content=' + fixJqText(Url.encode(content.getData()));
	var url = create_url('energyconservation-save');
	sys_submiting();
	$.ajax({type:'POST', url:url, data:parm,
		success: function(result) {
		sys_submiting_close();
			if ('success' == result) {
				sys_msg('操作成功!');
				sys_load_handle('energyconservation');
			}
		}
	});
}

function checkedEnergyConservation(){
	var title = $("#title").val();
	if(title.length==0){
		sys_msg('必须填写标题');
	}else{
		saveEnergyConservation();
	}
}
/******************************aidinit****************************/

/******************************aidbatchinit****************************/
